package com.clt.ess.gjzw.domain.updateProtectKey;


import com.clt.ess.gjzw.domain.SignInfo;
import com.clt.ess.gjzw.domain.TaskNumData;

import java.io.Serializable;
import java.util.List;

//对称密钥的保护密钥更新协议查询并下载公安下发数据请求接口参数
public class UpdateProtectKeyCheckResultRequest implements Serializable {
    //命令编码 checkResult
    //必须
    private String taskCode;
    //版本号 1.0
    //必须
    private String version;
    //业务类型编码，0 表示备案业务，1 表示保护密钥更新业务，2 表示印章撤销，3 表示申请电子印章唯一赋码业务
    //必须
    private String taskTypeCode;
    //任务编号类
    //必须
    private TaskNumData data;
    //签名信息
    // 必须
    private SignInfo signInfo;

    /**
     {
         "taskCode ":"checkResult",
         "version ":"1.0",
         "taskTypeCode":"1",
         "data":{
             " taskId ":"abcdefg123456"
         }
     }
     */

    public UpdateProtectKeyCheckResultRequest() {
    }

    public UpdateProtectKeyCheckResultRequest(String taskCode, String version, String taskTypeCode, TaskNumData data,
                                              SignInfo signInfo) {
        this.taskCode = taskCode;
        this.version = version;
        this.taskTypeCode = taskTypeCode;
        this.data = data;
        this.signInfo = signInfo;
    }

    public String getTaskCode() {
        return taskCode;
    }

    public void setTaskCode(String taskCode) {
        this.taskCode = taskCode;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public String getTaskTypeCode() {
        return taskTypeCode;
    }

    public void setTaskTypeCode(String taskTypeCode) {
        this.taskTypeCode = taskTypeCode;
    }

    public TaskNumData getData() {
        return data;
    }

    public void setData(TaskNumData data) {
        this.data = data;
    }

    public SignInfo getSignInfo() {
        return signInfo;
    }

    public void setSignInfo(SignInfo signInfo) {
        this.signInfo = signInfo;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("{");
        sb.append("\"taskCode\":\"")
                .append(taskCode).append('\"');
        sb.append(",\"version\":\"")
                .append(version).append('\"');
        sb.append(",\"taskTypeCode\":\"")
                .append(taskTypeCode).append('\"');
        sb.append(",\"data\":")
                .append(data);
        if(signInfo!=null && signInfo.getSignValue()!=null && !"".equals(signInfo.getSignValue())){
            sb.append(",\"signInfo\":")
                    .append(signInfo);
        }
        sb.append('}');
        return sb.toString();
    }
}
